package com.example.demo.util;


import com.alibaba.fastjson.JSON;
import com.example.demo.domain.MyMessage;

/* ━━━━━━佛祖保佑━━━━━━
 *                  ,;,,;
 *                ,;;'(    社
 *      __      ,;;' ' \   会
 *   /'  '\'~~'~' \ /'\.)  主
 * ,;(      )    /  |.     义
 *,;' \    /-.,,(   ) \    码
 *     ) /       ) / )|    农
 *     ||        ||  \)
 *     (_\       (_\
 * ━━━━━━永无BUG━━━━━━
 * @author ：zjq
 * @date ：2021/4/7 0:38
 * @description: TODO
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 */
public class MsgUtil {

    public static MyMessage buildMsg(String channelId, String content) {
        return new MyMessage(channelId, content);
    }

    public static MyMessage json2Obj(String objJsonStr) {
        return JSON.parseObject(objJsonStr, MyMessage.class);
    }

    public static String obj2Json(MyMessage msgAgreement) {
        return JSON.toJSONString(msgAgreement);
    }

    private boolean test;

    public boolean isTest() {
        return test;
    }

    public void setTest(boolean test) {
        this.test = test;
    }

    public static void main(String[] args) {
        MsgUtil m=new MsgUtil();

        System.out.println( m.isTest());
    }

}
